import { SortOrder } from "antd/es/table/interface";

export const formatOrderParams = (sort?: Record<string, SortOrder>) => {
  if (!sort) return {};
  const result: Record<string, string> = {};
  Object.entries(sort).map(([key, value]) => {
    result[`orderByColumn`] = key;
    result[`isAsc`] = value === "ascend" ? "ascending" : "descending";
  });
  return result;
};
